<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// Create a shortcut for params.
$params = &$this->item->params;
$images = json_decode($this->item->images);
$canEdit	= $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::core();


preg_match('/youtube.com\/embed\/(.*?)\?/', $this->item->introtext, $match);
$video = $match[1];
//echo $video;

preg_match('/\<img(.*?)src=\"(.*?)\"/', $this->item->introtext, $match);
$image = $match[2];

if($image == "") $image = JURI::base()."templates/phuot/images/noimage.png";

?>

<span href="#change" onclick="changeVideo('<?php echo $video; ?>', this);">
	<img src="<?php echo $image; ?>" border="0" /><br />
	<p><?php echo $this->escape($this->item->title); ?></p>
</span>


<?php echo $this->item->event->afterDisplayContent; ?>